class Main extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            canchou: !1,
            type: 'THANKS',
            showresult: !1,
            showinfomodal: !1,
            data: {
                tx: 0,
                zb: 0,
                wine: 0,
            }
        };
    }










    componentDidMount() {
        let myphone = localStorage.getItem('phone')
        if (myphone != null) {
            myphone = maskPhoneNumber(myphone)
            this.setState({ myphone })
        }
        配置微信('mygift')
        我的奖品(res => {
            if (res.issuccess == 1) {
                let { data } = res;
                if (data != null) {
                    this.setState({ data: data })
                }
            }
        })
    }


    chou() {
        let { canchou } = this.state
        console.log(canchou, 'canchou');
        if (canchou) {
            this.setState({ showresult: !0 })
        } else {
            alert('您还未集齐碎片')
        }

    }
    inputchange(type, e) {
        this.setState({ [type]: e.target.value })
    }
    submit() {
        alert('提交成功')
        window.location.href = './main.html'
    }



    render() {
        let { myphone, data, name, isagree, showresult, showinfomodal } = this.state

        return (
            <div className="app">
                <div className="myinfo">您好,{myphone}</div>
                <img loading="lazy" className="bg" src="./src/detail_bg.png" alt="" />

                <div className="infomodal">
                    <div className="infodiv">
                        <p className="ttitle">中奖记录</p>
                        <div className="title">
                            <p>奖品名称</p>
                            <p>数量</p>
                        </div>
                         <div>
                            <p>国缘V3小酒版</p>
                            <p className="num">{data.wine}</p>
                        </div>
                        <div>
                            <p>苏超周边钥匙扣</p>
                            <p className="num">{data.zb}</p>
                        </div>
                        <div>
                            <p>腾讯视频VIP季卡</p>
                            <p className="num">{data.tx}</p>
                        </div>
                       
                    </div>
                    {/* <div className="btns">

                        <img onClick={this.submit.bind(this)} className="back" src="./src/tijiaobtn.png" alt="" />
                    </div> */}
                    <img onClick={() => {
                        window.location.href = './main.html'
                    }} src="./src/close.png" className="close" alt="" />

                </div>

            </div>


        )
    }
}

ReactDOM.render(
    <div>
        {/* <TopLine /> */}
        <div id='body'>

            <Main />
        </div>
    </div>
    // <Barrage />
    , $('.container')[0]
)